<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2016/7/31
  Time: 9:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<script type="text/javascript" src="/static/easyui/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#add").click(function(){
            var userName = $("#userName").attr("value");
            var age =$("#age").attr("value");

            var user2 = {userName:userName,age:age};

            $.ajax({
                url:"/test/addUserJson",
                type:"post",
                data:user2,
                success:function(a){
                    alert("userName--->" + a.userName + "age--->" + a.age );

                }
            });



        });
    });
</script>
</head>
<body>
<h>json添加用户</h>
姓名：<input type="text" id="userName" name="userName">
年龄：<input type="text" id="age" name="age">
<input type="button" id="add" value="添加">

</body></html>
